package com.neu.question.mapper;

import com.neu.question.domain.RootPermissionInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
* @author DELL
* @description 针对表【root_permission_info】的数据库操作Mapper
* @createDate 2022-10-31 19:09:10
* @Entity com.neu.question.domain.RootPermissionInfo
*/
@Mapper
public interface RootPermissionInfoMapper extends BaseMapper<RootPermissionInfo> {

    /**
     * 获取角色权限
     *
     * @param roleId
     * @return
     */
    List<String> findPermissionByRoleId(String roleId);

    /**
     * 获取admin角色权限
     *
     * @return
     */
    List<Map<String, Object>> findPermissionByAdminId(@Param("permission") String permission);

    /**
     * 查找全部的權限
     *
     * @return
     */
    List<RootPermissionInfo> selectAll();

    /**
     * 角色添加权限
     *
     * @param map
     * @return
     */
    int addRootPermission(Map<String, Object> map);

    /**
     * 清空数据库里角色的权限信息
     *
     * @param role
     * @return
     */
    int deletePermissionByRoot(String role);

    /**
     * 查找默认的权限
     *
     * @return
     */
    List<Map<String, Object>> findPermissionByAdminIdDefault();

    /**
     * 修改权限路径
     *
     * @param map
     * @return
     */
    int modifyPathIdByPermission(Map<String, Object> map);

    /**
     * 删除模块对应的权限
     *
     * @param map
     * @return
     */
    int deletePermissionInfo(Map<String, Object> map);

    /**
     * 为角色添加项目和问卷管理
     *
     * @param map
     */
    int addRootPermissionByAdmin(Map<String, Object> map);

    /**
     * 修改权限对应的角色名
     *
     * @param map
     * @return
     */
    int modifyPermissionByRoleId(Map<String, Object> map);
}




